/*
 * Copyright (C) 2018 XiaoMi, Inc.
 * Copyright (C) 2021 XiaoMi, Inc.
 * Copyright (C) 2020 XiaoMi, Inc.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 as
 * published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 * See http://www.gnu.org/licenses/gpl-2.0.html for more details.
 */

/*****************************************************************************
 *
 * Filename:
 * ---------
 *	 s5k3t2ofilmmipiraw_Sensor.h
 *
 * Project:
 * --------
 *	 ALPS
 *
 * Description:
 * ------------
 *	 CMOS sensor header file
 *
 ****************************************************************************/
#ifndef _S5K3T2OFILMMIPI_SENSOR_H
#define _S5K3T2OFILMMIPI_SENSOR_H

static kal_uint16 addr_data_pair_init_3t2[] = {
	0x6028, 0x2000,
	0x602A, 0x3AEC,
	0x6F12, 0x0000,
	0x6F12, 0x0000,
	0x6F12, 0x0549,
	0x6F12, 0x0448,
	0x6F12, 0x054A,
	0x6F12, 0xC1F8,
	0x6F12, 0x2C05,
	0x6F12, 0x101A,
	0x6F12, 0xA1F8,
	0x6F12, 0x3005,
	0x6F12, 0x00F0,
	0x6F12, 0x7BB8,
	0x6F12, 0x2000,
	0x6F12, 0x3CA0,
	0x6F12, 0x2000,
	0x6F12, 0x2670,
	0x6F12, 0x2000,
	0x6F12, 0x9C00,
	0x6F12, 0x70B5,
	0x6F12, 0x0646,
	0x6F12, 0x4348,
	0x6F12, 0x0022,
	0x6F12, 0x0168,
	0x6F12, 0x0C0C,
	0x6F12, 0x8DB2,
	0x6F12, 0x2946,
	0x6F12, 0x2046,
	0x6F12, 0x00F0,
	0x6F12, 0x9BF8,
	0x6F12, 0x3046,
	0x6F12, 0x00F0,
	0x6F12, 0x9DF8,
	0x6F12, 0x3D48,
	0x6F12, 0x3E4A,
	0x6F12, 0x0830,
	0x6F12, 0x0188,
	0x6F12, 0x1180,
	0x6F12, 0x911C,
	0x6F12, 0x4088,
	0x6F12, 0x0880,
	0x6F12, 0x2946,
	0x6F12, 0x2046,
	0x6F12, 0xBDE8,
	0x6F12, 0x7040,
	0x6F12, 0x0122,
	0x6F12, 0x00F0,
	0x6F12, 0x89B8,
	0x6F12, 0x70B5,
	0x6F12, 0x0646,
	0x6F12, 0x3548,
	0x6F12, 0x0022,
	0x6F12, 0x4068,
	0x6F12, 0x84B2,
	0x6F12, 0x050C,
	0x6F12, 0x2146,
	0x6F12, 0x2846,
	0x6F12, 0x00F0,
	0x6F12, 0x7EF8,
	0x6F12, 0x3046,
	0x6F12, 0x00F0,
	0x6F12, 0x85F8,
	0x6F12, 0x3149,
	0x6F12, 0x314B,
	0x6F12, 0x0120,
	0x6F12, 0x0988,
	0x6F12, 0x40EA,
	0x6F12, 0x0110,
	0x6F12, 0x5881,
	0x6F12, 0x2F48,
	0x6F12, 0x0078,
	0x6F12, 0x68B1,
	0x6F12, 0x0022,
	0x6F12, 0x2E48,
	0x6F12, 0x2F49,
	0x6F12, 0x80F8,
	0x6F12, 0xC428,
	0x6F12, 0x0A80,
	0x6F12, 0x2E49,
	0x6F12, 0x0E78,
	0x6F12, 0x36B1,
	0x6F12, 0x90F8,
	0x6F12, 0xE803,
	0x6F12, 0x18B1,
	0x6F12, 0x0120,
	0x6F12, 0x02E0,
	0x6F12, 0x0122,
	0x6F12, 0xF0E7,
	0x6F12, 0x0020,
	0x6F12, 0x4978,
	0x6F12, 0x01B1,
	0x6F12, 0x42B1,
	0x6F12, 0x0021,
	0x6F12, 0x40EA,
	0x6F12, 0x0110,
	0x6F12, 0x5880,
	0x6F12, 0x00F0,
	0x6F12, 0x66F8,
	0x6F12, 0x0128,
	0x6F12, 0x02D0,
	0x6F12, 0x1BE0,
	0x6F12, 0x0121,
	0x6F12, 0xF5E7,
	0x6F12, 0x2248,
	0x6F12, 0x234A,
	0x6F12, 0x234E,
	0x6F12, 0xB0F8,
	0x6F12, 0x7211,
	0x6F12, 0x92F8,
	0x6F12, 0x9420,
	0x6F12, 0x90F8,
	0x6F12, 0x7401,
	0x6F12, 0xD140,
	0x6F12, 0xD040,
	0x6F12, 0x4318,
	0x6F12, 0x96F8,
	0x6F12, 0x7F63,
	0x6F12, 0x581E,
	0x6F12, 0x022E,
	0x6F12, 0x03D9,
	0x6F12, 0x0220,
	0x6F12, 0x9040,
	0x6F12, 0x181A,
	0x6F12, 0x401C,
	0x6F12, 0x164A,
	0x6F12, 0x703A,
	0x6F12, 0x1180,
	0x6F12, 0x911C,
	0x6F12, 0x0880,
	0x6F12, 0x2146,
	0x6F12, 0x2846,
	0x6F12, 0xBDE8,
	0x6F12, 0x7040,
	0x6F12, 0x0122,
	0x6F12, 0x00F0,
	0x6F12, 0x31B8,
	0x6F12, 0x10B5,
	0x6F12, 0x0022,
	0x6F12, 0xAFF2,
	0x6F12, 0xB501,
	0x6F12, 0x1348,
	0x6F12, 0x00F0,
	0x6F12, 0x3EF8,
	0x6F12, 0x064C,
	0x6F12, 0x0022,
	0x6F12, 0xAFF2,
	0x6F12, 0xFF01,
	0x6F12, 0x6060,
	0x6F12, 0x1048,
	0x6F12, 0x00F0,
	0x6F12, 0x36F8,
	0x6F12, 0x0F49,
	0x6F12, 0x2060,
	0x6F12, 0x7A20,
	0x6F12, 0x0968,
	0x6F12, 0x4883,
	0x6F12, 0x10BD,
	0x6F12, 0x2000,
	0x6F12, 0x3C90,
	0x6F12, 0x4000,
	0x6F12, 0x950C,
	0x6F12, 0x2000,
	0x6F12, 0x16F0,
	0x6F12, 0x4000,
	0x6F12, 0xD000,
	0x6F12, 0x2000,
	0x6F12, 0x19A0,
	0x6F12, 0x2000,
	0x6F12, 0x30C0,
	0x6F12, 0x4000,
	0x6F12, 0x9800,
	0x6F12, 0x2000,
	0x6F12, 0x1DD0,
	0x6F12, 0x2000,
	0x6F12, 0x17C0,
	0x6F12, 0x2000,
	0x6F12, 0x2210,
	0x6F12, 0x2000,
	0x6F12, 0x2670,
	0x6F12, 0x0000,
	0x6F12, 0xF45F,
	0x6F12, 0x0000,
	0x6F12, 0xD957,
	0x6F12, 0x2000,
	0x6F12, 0x08C0,
	0x6F12, 0x49F6,
	0x6F12, 0x213C,
	0x6F12, 0xC0F2,
	0x6F12, 0x000C,
	0x6F12, 0x6047,
	0x6F12, 0x4DF6,
	0x6F12, 0x571C,
	0x6F12, 0xC0F2,
	0x6F12, 0x000C,
	0x6F12, 0x6047,
	0x6F12, 0x4FF2,
	0x6F12, 0x5F4C,
	0x6F12, 0xC0F2,
	0x6F12, 0x000C,
	0x6F12, 0x6047,
	0x6F12, 0x44F2,
	0x6F12, 0x9B0C,
	0x6F12, 0xC0F2,
	0x6F12, 0x000C,
	0x6F12, 0x6047,
	0x6F12, 0x4BF2,
	0x6F12, 0xED0C,
	0x6F12, 0xC0F2,
	0x6F12, 0x000C,
	0x6F12, 0x6047,
	0x6F12, 0x0000,
	0x6028, 0x2000,
	0x602A, 0x1014,
	0x6F12, 0x0100,
	0x6F12, 0x7000,
	0x602A, 0x108A,
	0x6F12, 0x0006,
	0x602A, 0x1092,
	0x6F12, 0x0005,
	0x602A, 0x1096,
	0x6F12, 0x0002,
	0x6F12, 0x001A,
	0x602A, 0x109C,
	0x6F12, 0x0014,
	0x602A, 0x10A2,
	0x6F12, 0x0022,
	0x602A, 0x10AE,
	0x6F12, 0x0007,
	0x602A, 0x10C2,
	0x6F12, 0x001E,
	0x602A, 0x10F4,
	0x6F12, 0x0003,
	0x6F12, 0x0003,
	0x602A, 0x110A,
	0x6F12, 0x0000,
	0x602A, 0x113E,
	0x6F12, 0x0001,
	0x6F12, 0x014E,
	0x602A, 0x13EA,
	0x6F12, 0x160F,
	0x6F12, 0x0D00,
	0x602A, 0x13FA,
	0x6F12, 0x009D,
	0x6F12, 0x0107,
	0x602A, 0x14E2,
	0x6F12, 0x04C2,
	0x6F12, 0x02AE,
	0x6F12, 0x0020,
	0x6028, 0x4000,
	0xF44A, 0x0010,
	0xF46A, 0xB6A0,
	0x6028, 0x2000,
	0x602A, 0x0F5E,
	0x6F12, 0x0200,
	0x602A, 0x0F90,
	0x6F12, 0x0000,
	0x602A, 0x17C0,
	0x6F12, 0x0010,
	0x6F12, 0x0201,
	0x602A, 0x1DA2,
	0x6F12, 0x0001,
	0x6F12, 0x0203,
	0x6F12, 0x0405,
	0x6F12, 0x0607,
	0x6F12, 0x0809,
	0x6F12, 0x0A0B,
	0x6F12, 0x0C0D,
	0x6F12, 0x0E0F,
	0x6028, 0x4000,
	0x020C, 0x0001,
	0x0BC6, 0x0000,
	0x0D00, 0x0000,
	0xB13C, 0x0800,
};

static kal_uint16 addr_data_pair_pre_3t2[] = {
	0x6028, 0x4000,
	0x0136, 0x1800,
	0x013E, 0x0000,
	0x0304, 0x0004,
	0x0306, 0x00C6,
	0x6028, 0x2000,
	0x602A, 0x0E0E,
	0x6F12, 0x0102,
	0x6F12, 0x0000,
	0x6028, 0x4000,
	0x030C, 0x0000,
	0x0302, 0x0001,
	0x0300, 0x0007,
	0x030E, 0x0004,
	0x0310, 0x00BC,
	0x0312, 0x0002,
	0x0308, 0x0008,
	0x030A, 0x0001,
	0x0344, 0x0008,
	0x0346, 0x0008,
	0x0348, 0x1447,
	0x034A, 0x0F2F,
	0x034C, 0x0A20,
	0x034E, 0x0794,
	0x0350, 0x0000,
	0x0352, 0x0000,
	0x0900, 0x0122,
	0x0404, 0x1000,
	0x0380, 0x0002,
	0x0382, 0x0002,
	0x0384, 0x0002,
	0x0386, 0x0002,
	0x0342, 0x2A80,
	0x0340, 0x081E,
	0x6028, 0x4000,
	0x010C, 0x0000,
	0x0114, 0x0300,
	0x0116, 0x3000,
	0x011A, 0x0001,
	0x0118, 0x0002,
	0x6028, 0x2000,
	0x602A, 0x0E92,
	0x6F12, 0xFFFF,
	0x6028, 0x4000,
	0x0B04, 0x0001,
	0x0B06, 0x0101,
	0x0FEA, 0x04A0,
	0x6028, 0x2000,
	0x602A, 0x3C98,
	0x6F12, 0x052C,
	0x6F12, 0x0A3B,
	0x602A, 0x1DA0,
	0x6F12, 0x0010,
	0x602A, 0x10AC,
	0x6F12, 0x0014,
	0x602A, 0x1110,
	0x6F12, 0x001D,
	0x6F12, 0x004D,
	0x602A, 0x13E8,
	0x6F12, 0x080F,
	0x602A, 0x13F8,
	0x6F12, 0x38C8,
};

static kal_uint16 addr_data_pair_cap_3t2[] = {
	0x6028, 0x4000,
	0x0136, 0x1800,
	0x013E, 0x0000,
	0x0304, 0x0004,
	0x0306, 0x00C6,
	0x6028, 0x2000,
	0x602A, 0x0E0E,
	0x6F12, 0x0102,
	0x6F12, 0x0000,
	0x6028, 0x4000,
	0x030C, 0x0000,
	0x0302, 0x0001,
	0x0300, 0x0007,
	0x030E, 0x0004,
	0x0310, 0x00BC,
	0x0312, 0x0002,
	0x0308, 0x0008,
	0x030A, 0x0001,
	0x0344, 0x0008,
	0x0346, 0x0008,
	0x0348, 0x1447,
	0x034A, 0x0F2F,
	0x034C, 0x0A20,
	0x034E, 0x0794,
	0x0350, 0x0000,
	0x0352, 0x0000,
	0x0900, 0x0122,
	0x0404, 0x1000,
	0x0380, 0x0002,
	0x0382, 0x0002,
	0x0384, 0x0002,
	0x0386, 0x0002,
	0x0342, 0x2A80,
	0x0340, 0x081E,
	0x6028, 0x4000,
	0x010C, 0x0000,
	0x0114, 0x0300,
	0x0116, 0x3000,
	0x011A, 0x0001,
	0x0118, 0x0002,
	0x6028, 0x2000,
	0x602A, 0x0E92,
	0x6F12, 0xFFFF,
	0x6028, 0x4000,
	0x0B04, 0x0001,
	0x0B06, 0x0101,
	0x0FEA, 0x04A0,
	0x6028, 0x2000,
	0x602A, 0x3C98,
	0x6F12, 0x052C,
	0x6F12, 0x0A3B,
	0x602A, 0x1DA0,
	0x6F12, 0x0010,
	0x602A, 0x10AC,
	0x6F12, 0x0014,
	0x602A, 0x1110,
	0x6F12, 0x001D,
	0x6F12, 0x004D,
	0x602A, 0x13E8,
	0x6F12, 0x080F,
	0x602A, 0x13F8,
	0x6F12, 0x38C8,
};

static kal_uint16 addr_data_pair_video_3t2[] = {
	0x6028, 0x4000,
	0x0136, 0x1800,
	0x013E, 0x0000,
	0x0304, 0x0004,
	0x0306, 0x00C6,
	0x6028, 0x2000,
	0x602A, 0x0E0E,
	0x6F12, 0x0102,
	0x6F12, 0x0000,
	0x6028, 0x4000,
	0x030C, 0x0000,
	0x0302, 0x0001,
	0x0300, 0x0007,
	0x030E, 0x0004,
	0x0310, 0x00BC,
	0x0312, 0x0002,
	0x0308, 0x0008,
	0x030A, 0x0001,
	0x0344, 0x0008,
	0x0346, 0x0008,
	0x0348, 0x1447,
	0x034A, 0x0F2F,
	0x034C, 0x0A20,
	0x034E, 0x0794,
	0x0350, 0x0000,
	0x0352, 0x0000,
	0x0900, 0x0122,
	0x0404, 0x1000,
	0x0380, 0x0002,
	0x0382, 0x0002,
	0x0384, 0x0002,
	0x0386, 0x0002,
	0x0342, 0x2A80,
	0x0340, 0x081E,
	0x6028, 0x4000,
	0x010C, 0x0000,
	0x0114, 0x0300,
	0x0116, 0x3000,
	0x011A, 0x0001,
	0x0118, 0x0002,
	0x6028, 0x2000,
	0x602A, 0x0E92,
	0x6F12, 0xFFFF,
	0x6028, 0x4000,
	0x0B04, 0x0001,
	0x0B06, 0x0101,
	0x0FEA, 0x04A0,
	0x6028, 0x2000,
	0x602A, 0x3C98,
	0x6F12, 0x052C,
	0x6F12, 0x0A3B,
	0x602A, 0x1DA0,
	0x6F12, 0x0010,
	0x602A, 0x10AC,
	0x6F12, 0x0014,
	0x602A, 0x1110,
	0x6F12, 0x001D,
	0x6F12, 0x004D,
	0x602A, 0x13E8,
	0x6F12, 0x080F,
	0x602A, 0x13F8,
	0x6F12, 0x38C8,
};

static kal_uint16 addr_data_pair_hs_video_3t2[] = {
	0x6028, 0x4000,
	0x0136, 0x1800,
	0x013E, 0x0000,
	0x0304, 0x0004,
	0x0306, 0x00C6,
	0x6028, 0x2000,
	0x602A, 0x0E0E,
	0x6F12, 0x0102,
	0x6F12, 0x0000,
	0x6028, 0x4000,
	0x030C, 0x0000,
	0x0302, 0x0001,
	0x0300, 0x0007,
	0x030E, 0x0004,
	0x0310, 0x00BC,
	0x0312, 0x0002,
	0x0308, 0x0008,
	0x030A, 0x0001,
	0x0344, 0x0028,
	0x0346, 0x01FC,
	0x0348, 0x1427,
	0x034A, 0x0D3B,
	0x034C, 0x0500,
	0x034E, 0x02D0,
	0x0350, 0x0000,
	0x0352, 0x0000,
	0x0900, 0x0124,
	0x0404, 0x2000,
	0x0380, 0x0002,
	0x0382, 0x0002,
	0x0384, 0x0002,
	0x0386, 0x0006,
	0x0342, 0x1620,
	0x0340, 0x03E0,
	0x6028, 0x4000,
	0x010C, 0x0000,
	0x0114, 0x0300,
	0x0116, 0x3000,
	0x011A, 0x0001,
	0x0118, 0x0002,
	0x6028, 0x2000,
	0x602A, 0x0E92,
	0x6F12, 0xFFFF,
	0x6028, 0x4000,
	0x0B04, 0x0001,
	0x0B06, 0x0101,
	0x0FEA, 0x04A0,
	0x6028, 0x2000,
	0x602A, 0x3C98,
	0x6F12, 0x0296,
	0x6F12, 0x0515,
	0x602A, 0x1DA0,
	0x6F12, 0x0110,
	0x602A, 0x10AC,
	0x6F12, 0x0014,
	0x602A, 0x1110,
	0x6F12, 0x001D,
	0x6F12, 0x004D,
	0x602A, 0x13E8,
	0x6F12, 0x080F,
	0x602A, 0x13F8,
	0x6F12, 0x38C8,
};

enum IMGSENSOR_MODE {
	IMGSENSOR_MODE_INIT,
	IMGSENSOR_MODE_PREVIEW,
	IMGSENSOR_MODE_CAPTURE,
	IMGSENSOR_MODE_VIDEO,
	IMGSENSOR_MODE_HIGH_SPEED_VIDEO,
	IMGSENSOR_MODE_SLIM_VIDEO,
};

struct imgsensor_mode_struct {
	kal_uint32 pclk;	/* record different mode's pclk */
	kal_uint32 linelength;	/* record different mode's linelength */
	kal_uint32 framelength;	/* record different mode's framelength */

	kal_uint8 startx; /* record different mode's startx of grabwindow */
	kal_uint8 starty; /* record different mode's startx of grabwindow */

	/* record different mode's width of grabwindow */
	kal_uint16 grabwindow_width;

	/* record different mode's height of grabwindow */
	kal_uint16 grabwindow_height;

	/* following for MIPIDataLowPwr2HighSpeedSettleDelayCount
	 * by different scenario
	 */
	kal_uint8 mipi_data_lp2hs_settle_dc;

	/*       following for GetDefaultFramerateByScenario()  */
	kal_uint16 max_framerate;
	kal_uint32 mipi_pixel_rate;

};

/* SENSOR PRIVATE STRUCT FOR VARIABLES*/
struct imgsensor_struct {
	kal_uint8 mirror;	/* mirrorflip information */

	kal_uint8 sensor_mode;	/* record IMGSENSOR_MODE enum value */

	kal_uint32 shutter;	/* current shutter */
	kal_uint16 gain;	/* current gain */

	kal_uint32 pclk;	/* current pclk */

	kal_uint32 frame_length;	/* current framelength */
	kal_uint32 line_length;	/* current linelength */

	/* current min	framelength to max framerate */
	kal_uint32 min_frame_length;
	kal_uint16 dummy_pixel;	/* current dummypixel */
	kal_uint16 dummy_line;	/* current dummline */

	kal_uint16 current_fps;	/* current max fps */
	kal_bool autoflicker_en; /* record autoflicker enable or disable */
	kal_bool test_pattern;	/* record test pattern mode or not */

	/* current scenario id */
	enum MSDK_SCENARIO_ID_ENUM current_scenario_id;
	kal_uint8 ihdr_en;	/* ihdr enable or disable */

	kal_uint8 hdr_mode;	/* HDR mODE : 0: disable HDR, 1:IHDR, 2:HDR, 9:ZHDR */

	kal_uint8 i2c_write_id;	/* record current sensor's i2c write id */
	kal_uint8 pdaf_mode;	/* added 2016.07.08 by dj */
};

/* SENSOR PRIVATE STRUCT FOR CONSTANT*/
struct imgsensor_info_struct {
	kal_uint16 sensor_id;	/* record sensor id defined in Kd_imgsensor.h */
	kal_uint32 checksum_value; /* checksum value for Camera Auto Test */

	/* preview scenario relative information */
	struct imgsensor_mode_struct pre;

	/* capture scenario relative information */
	struct imgsensor_mode_struct cap;

	/* capture for PIP 24fps relative information */
	struct imgsensor_mode_struct cap1;

	/* capture for PIP 24fps relative information */
	struct imgsensor_mode_struct cap2;

	/* normal video  scenario relative information */
	struct imgsensor_mode_struct normal_video;

	/* high speed video scenario relative information */
	struct imgsensor_mode_struct hs_video;

	/* slim video for VT scenario relative information */
	struct imgsensor_mode_struct slim_video;
	kal_uint8 ae_shut_delay_frame;	/* shutter delay frame for AE cycle */

	/* sensor gain delay frame for AE cycle */
	kal_uint8 ae_sensor_gain_delay_frame;

	/* isp gain delay frame for AE cycle */
	kal_uint8 ae_ispGain_delay_frame;

	kal_uint8 ihdr_support;	/* 1, support; 0,not support */
	kal_uint8 ihdr_le_firstline;	/* 1,le first ; 0, se first */
	kal_uint8 sensor_mode_num;	/* support sensor mode num */

	kal_uint8 cap_delay_frame;	/* enter capture delay frame num */
	kal_uint8 pre_delay_frame;	/* enter preview delay frame num */
	kal_uint8 video_delay_frame;	/* enter video delay frame num */

	/* enter high speed video  delay frame num */
	kal_uint8 hs_video_delay_frame;

	kal_uint8 slim_video_delay_frame; /* enter slim video delay frame num */

	kal_uint8 margin;	/* sensor framelength & shutter margin */
	kal_uint32 min_shutter;	/* min shutter */
	kal_uint32 min_gain;
	kal_uint32 max_gain;
	kal_uint32 min_gain_iso;
	kal_uint32 gain_step;
	kal_uint32 gain_type;

	/* max framelength by sensor register's limitation */
	kal_uint32 max_frame_length;

	kal_uint8 isp_driving_current;	/* mclk driving current */
	kal_uint8 sensor_interface_type;	/* sensor_interface_type */

	kal_uint8 mipi_sensor_type;
	/* 0,MIPI_OPHY_NCSI2; 1,MIPI_OPHY_CSI2,
	 * default is NCSI2, don't modify this para
	 */

	kal_uint8 mipi_settle_delay_mode;
	/* 0, high speed signal auto detect;
	 * 1, use settle delay,unit is ns,
	 * default is auto detect, don't modify this para
	 */

	kal_uint8 sensor_output_dataformat;
	kal_uint8 mclk;	/* mclk value, suggest 24 or 26 for 24Mhz or 26Mhz */

	kal_uint8 mipi_lane_num;	/* mipi lane num */

	/* record sensor support all write id addr,
	 * only supprt 4must end with 0xff
	 */
	kal_uint32 i2c_speed;
	kal_uint8 i2c_addr_table[5];

};

/* SENSOR READ/WRITE ID */
/* #define IMGSENSOR_WRITE_ID_1 (0x6c) */
/* #define IMGSENSOR_READ_ID_1  (0x6d) */
/* #define IMGSENSOR_WRITE_ID_2 (0x20) */
/* #define IMGSENSOR_READ_ID_2  (0x21) */

extern int iReadRegI2C(u8 *a_pSendData, u16 a_sizeSendData,
				u8 *a_pRecvData, u16 a_sizeRecvData, u16 i2cId);

extern int iWriteRegI2C(u8 *a_pSendData, u16 a_sizeSendData, u16 i2cId);
/* extern bool read_2T7_eeprom(kal_uint16 addr, BYTE* data, kal_uint32 size); */

extern int iReadReg(u16 a_u2Addr, u8 *a_puBuff, u16 i2cId);
extern int iWriteReg(u16 a_u2Addr, u32 a_u4Data, u32 a_u4Bytes, u16 i2cId);
extern void kdSetI2CSpeed(u16 i2cSpeed);




extern int iReadRegI2CTiming(u8 *a_pSendData, u16 a_sizeSendData,
				    u8 *a_pRecvData, u16 a_sizeRecvData,
				    u16 i2cId, u16 timing);


extern int iWriteRegI2CTiming(u8 *a_pSendData, u16 a_sizeSendData,
				     u16 i2cId, u16 timing);

extern int iBurstWriteReg_multi(u8 *pData, u32 bytes, u16 i2cId,
					u16 transfer_length, u16 timing);



/*extern bool s5k2t7_read_otp_pdaf_data(*/
/*kal_uint16 addr, BYTE *data, kal_uint32 size);*/
#endif				/* _S5K3P38SRMIPI_SENSOR_H */
